package com.atguigu.day06;

public class Test08 {
    public static void main(String[] args) {
        System.out.println(fn(3));
    }

    static int fn(int n) {
        if (n >= 5 && n < 10000) {
            if (n == 1) {
                return 1;
            } else {
                return (n + fn(n - 1));
            }
        } else {
            System.out.println("输入不合法!");
            return -1;
        }
    }
}
